> ## Documentation Index
> Fetch the complete documentation index at: https://sequence-0fb8d9e6-api_docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Sessions

> Documentation for Unreal SDK API to manage sessions for the Sequence infrastructure stack for web3 gaming.

<Warning>
  The examples below apply to versions 2.x.x.
  If you’re using version 3, use the SequenceEmbeddedWalletBP (Blueprints) and SequenceEmbeddedWallet (C++) classes instead.
</Warning>

## Get Id Token

A common use case is to verify the user identity on your backend after the user has finished the login process in your app client.
Get a Sequence Id Token from your users to send it to your backend for verification using any JWKS library.
Read our [Backend Verification Guide](/sdk/headless-wallet/verification) for more information.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-api_docs/5qRi1hX9kOJYII26/images/unreal/get_id_token.png?fit=max&auto=format&n=5qRi1hX9kOJYII26&q=85&s=462b884ac82d45bce2409fc664859808" width="2118" height="1198" data-path="images/unreal/get_id_token.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (FSeqIdTokenResponse_Data)> OnApiSuccess = [OnSuccess](const FSeqIdTokenResponse_Data& Data) { };
    const TFunction<void (FSequenceError)> OnApiFailure = [OnFailure](const FSequenceError& Err) { };

    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->GetIdToken(Nonce, OnApiSuccess, OnApiFailure);
    ```
  </Tab>
</Tabs>

## Check Existing Session

Check if your client has an existing session stored.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-api_docs/CmKz04BVDGuy1x-Z/images/unreal/check_existing_session.png?fit=max&auto=format&n=CmKz04BVDGuy1x-Z&q=85&s=1593122d029ad742b44498c6a8f24361" width="2242" height="1184" data-path="images/unreal/check_existing_session.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    USequenceSessions* Sessions = NewObject<USequenceSessions>();
    const bool Exists = Sessions->CheckExistingSession();
    ```
  </Tab>
</Tabs>

## Sign Out

Clear the credentials cache and sign out the current user.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-api_docs/uFPNPaUQoWqBdCiH/images/unreal/sign_out.png?fit=max&auto=format&n=uFPNPaUQoWqBdCiH&q=85&s=ad8d7d710d0d7526d4782413f2068b76" width="2242" height="1184" data-path="images/unreal/sign_out.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->SignOut();
    ```
  </Tab>
</Tabs>

## List Sessions

List the active sessions.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-api_docs/auazpVRK2iFuGS6h/images/unreal/list_sessions.png?fit=max&auto=format&n=auazpVRK2iFuGS6h&q=85&s=3ad04afc2917d90944099f2409830629" width="2242" height="1184" data-path="images/unreal/list_sessions.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (TArray<FSeqListSessions_Session>)> OnApiSuccess = [OnSuccess](const TArray<FSeqListSessions_Session>& Sessions) { };
    const TFunction<void (FSequenceError)> OnApiFailure = [OnFailure](const FSequenceError& Err) { };

    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->GetIdToken(Nonce, OnApiSuccess, OnApiFailure);
    ```
  </Tab>
</Tabs>

## List Accounts

List your accounts.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-api_docs/auazpVRK2iFuGS6h/images/unreal/list_accounts.png?fit=max&auto=format&n=auazpVRK2iFuGS6h&q=85&s=ee350960094e335775132f6fd97b7d92" width="2242" height="1184" data-path="images/unreal/list_accounts.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (FSeqListAccountsResponse_Data)> OnApiSuccess = [OnSuccess](const FSeqListAccountsResponse_Data& Sessions) { };
    const TFunction<void (FSequenceError)> OnApiFailure = [OnFailure](const FSequenceError& Err) { };

    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->GetIdToken(Nonce, OnApiSuccess, OnApiFailure);
    ```
  </Tab>
</Tabs>
